import $http from './request'

function JsontoForm(params) {
	let str = [];
	for (let key in params) {
		str.push(key + "=" + params[key])
	}
	return str.join('&');

}
export const api = {
	getSession: '/getSession', //保存用户信息
	getCount: '/getCount', //返回估分人数
	getConfigList: '/config/list',
	getAreasOrMajor: '/config/getAreasOrMajor', // 获取区域和专业下拉菜单信息
	getSchool: '/school/getSchool', // 获取学校下拉菜单信息
	logAssessment: '/assessRecord/logAssessment', //保存成绩
	checkScore: '/nationline/checkScore2',
	getQuestion: '/question/getQuestion',
	getRankInfo: '/assessRecord/getRankInfo',
	getNewsLink: '/mpnews/getNewsLink',
	findDetailAnalysis: 'retrial/findDetailAnalysis',
	getApprovalInfo: '/retrial/getApprovalInfo', //是否提前批
	getMajorsBySchool: '/school/getMajorsBySchool',
	getAreaByMajor: '/config/getAreaByMajor', //根据专业获取区域
	getSchools: '/school/listRelatedDinfo', //获取学校及附加信息
	getSchoolInfo: '/school/getSchoolInfo',
	getNewsList: '/course/list',
	getkfInfo: '/config/getKfInfo'
}

export function getajax(url, params) {
	return $http.get(url, params)
}
export function postajax(url, params) {
	// let myparams = JsontoForm(params);
	return $http.post(url, params)
}
